from django.db import models

# Create your models here.
from django.contrib.auth.models import AbstractUser
from django.db import models


class CustomUser(AbstractUser):
    mobile = models.CharField(max_length=15, unique=True)  # 手机号码字段
    USERNAME_FIELD = 'mobile'  # 使用手机号码作为用户名字段
    REQUIRED_FIELDS = []  # 其他必填字段（除了密码）

    def __str__(self):
        return self.mobile